package course.myra.testset;

import java.util.Comparator;

import javax.xml.ws.soap.AddressingFeature;

public class StudentComparator implements Comparator<Student> {

	@Override
	public int compare(Student stu1, Student stu2) {

		//定义结果变量
		int result = 0;
		//比较大小
		if(stu1.getStuScore()>stu2.getStuScore()) {
			result = 1;
		}else if(stu1.getStuScore()<stu2.getStuScore()) {
			result = -1;
		}
		//返回结果 从小到大
		//如果要求从大到小 *-1
		return result;
	}

}
